package org.example.weather.bigscreen.core.service;

import com.baomidou.dynamic.datasource.annotation.DS;
import org.example.weather.bigscreen.core.entity.StWeatherUpload;
import org.example.weather.bigscreen.core.repository.StWeatherUploadMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

@Service
public class WeatherUploadService {

    @Resource
    private StWeatherUploadMapper stWeatherUploadMapper;

    @DS("ShardedDataSource")
    public int batchInsert(List<StWeatherUpload> stWeatherUploads) {
        return stWeatherUploadMapper.batchInsert(stWeatherUploads);
    }
    @DS("ShardedDataSource")
    public StWeatherUpload selectByTime(Date uploadDate, String areaId) {
        return stWeatherUploadMapper.selectByTime(uploadDate, areaId);
    }
}
